package com.etc.service.impl;

import com.etc.dao.OrderInfoDao;
import com.etc.dao.impl.OrderInfoDaoImpl;
import com.etc.entity.OrderInfo;
import com.etc.service.OrderInfoService;
import com.etc.util.DBUtil;

public class OrderInfoServiceImpl implements OrderInfoService{
	private OrderInfoDao orderInfoDao = new OrderInfoDaoImpl();
	/**
	 * 添加一条未支付状态的订单信息（支付状态在dao已定义）
	 */
	@Override
	public boolean addOrderInfo(OrderInfo orderInfo) {
		return orderInfoDao.add(orderInfo) > 0;
	}
	/**
	 * 更改订单支付状态支付状态
	 */
	@Override
	public boolean updateOrderInfoStatus(Integer status, String payTime, String orderNo) {
		return orderInfoDao.updateStatus(status, payTime, orderNo) > 0;
	}
	/**
	 * 通过订单号查询订单信息
	 */
	@Override
	public OrderInfo findOrderInfoByOrderNo(String orderNo) {
		return orderInfoDao.findByOrderNo(orderNo);
	}
	

}
